home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************
- ADOBE SYSTEMS INCORPORATED
- Copyright 2002 Adobe Systems Incorporated
- All Rights Reserved
-
- NOTICE: Adobe permits you to use, modify, and distribute this
- file in accordance with the terms of the Adobe license agreement
- accompanying it. If you have received this file from a source
- other than Adobe, then your use, modification, or distribution
- of it requires the prior written permission of Adobe.
- ***************************************************************/
- /***************************************************************
- Author: Henry Lee
- ***************************************************************/
-
- /***************************************************************
-
- This script is executed on the current selection. The script
- makes the objects in the selection all capable of supporting
- "drag-and-drop" in preview and export. The script will set the
- movie clip flag to true and add in two lines of code to the
- selected objects.
-
- onButtonPress:
- this.startDrag();
-
- onButtonRelease:
- this.stopDrag();
-
- ***************************************************************/
-
- /***************************************************************
- To change the behavior of this script, make your changes below
- ***************************************************************/
-
- comp = application.currentComposition;
- objs = comp.selection;
-
- makeDraggable(objs);
-
- /***************************************************************
- DO NOT EDIT BELOW THIS LINE
- ***************************************************************/
-
-
- function makeDraggable(targets) {
- var startScript;
- var stopScript;
-
- for (var i=0; i<targets.length; i++) {
- targets[i].isMovieClip = true;
- if (targets[i].states.length < 1) {
- targets[i].addState();
- }
-
- startScript = targets[i].getHandlerScript(LMHandlerType.onButtonPress);
- startScript += "\nthis.startDrag();\n";
- stopScript = targets[i].getHandlerScript(LMHandlerType.onButtonRelease);
- stopScript += "\nthis.stopDrag();\n";
-
- targets[i].setHandlerScript(LMHandlerType.onButtonPress, startScript);
- targets[i].setHandlerScript(LMHandlerType.onButtonRelease, stopScript);
- }
- }
-
-